Skip to content

[API 37] Regenerate .NET for Android API documentation - #643

Merged
jonathanpeppers merged 13 commits into
mainfrom
jonathanpeppers/api-37-docs
Sep 16, 2026
Merged

jonathanpeppers merged 13 commits into
mainfrom
jonathanpeppers/api-37-docs

Conversation

@jonathanpeppers

@jonathanpeppers jonathanpeppers commented Aug 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • regenerate the .NET for Android reference documentation from the Android API 37 bindings
  • import authoritative documentation from the matching Android API 37 sources and Java reference documentation
  • preserve existing authored documentation across unchanged and projected managed signatures, including stable JNI-identity matches
  • retain historical API destinations required by the .NET for Android 34, 35, and 36 framework inventories
  • update removed-type redirects and stale references

API level

This update specifically targets Android API 37 (AndroidApiLevel=37, AndroidPlatformId=37.0). The published documentation continues to use the single .NET for Android product moniker rather than adding an API-level product dropdown.

Documentation preservation

The generated output was compared against the current main documentation and repaired to avoid replacing substantive authored content with placeholders, empty elements, syntax-only text, or attribution-only remarks.

Notable preservation work includes:

  • exact DocId and structural-signature matching
  • stable JNI registration matching when managed enum or parameter projections changed
  • type-level and member-level summaries, parameters, returns, values, and remarks
  • historical member records and framework-index membership for removed public destinations
  • app-function parameter descriptions mapped to the actual generated managed parameter names

Source import

The conservative importer is scoped to declarations introduced in API 37. It recognizes ApiSince=37, exact SupportedOSPlatform("android37.0") metadata, and inherited type availability where members have no direct version metadata.

The final cached source pass applied all eligible exact matches. A subsequent offline dry run reported:

  • 0 applicable changes
  • 0 errors

Validation

  • importer self-tests pass
  • all changed XML files parse successfully
  • zero ordinal duplicate DocIds
  • zero merge-conflict markers
  • zero localization-file changes
  • git diff --check passes
  • OpenPublishing passes
  • PoliCheck passes
  • CLA passes

@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers/api-37-docs branch from 118e7a2 to bad8458 Compare August 18, 2026 18:52
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review August 18, 2026 18:52
@jonathanpeppers
jonathanpeppers requested review from dalexsoto and a lite review from Copilot August 18, 2026 18:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API 37 regeneration drops authored documentation for at least 21 unchanged, signature-matched members across seven files, replacing real summaries/returns/remarks with To be added.. Confirmed examples include parcelable members in NetworkRegistrationInfo, PhysicalChannelConfig, and SubscriptionInfo; TelephonyManager request/radio-family members; six NetworkRegistrationInfoServiceType values; three PhoneNumberSource values; and AccessibleObject.IsAnnotationPresent. Please restore the main-branch prose and add a full signature-keyed preservation check so unchanged members cannot lose authored documentation.

@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers/api-37-docs branch from fce3462 to dc31eb0 Compare August 20, 2026 16:02
@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto Addressed in dc31eb0f and rebased onto latest main (31260d9f).

The preservation pass now matches members by exact C# signature, falling back to member name/kind/ordered parameter types when generated return or enum projections change. It restores both placeholder replacements and documentation elements removed entirely. Final audit: 130,052 matched members, 0 substantive-to-placeholder regressions, and 0 missing substantive elements. I also resolved the rebase's 69 duplicate DocIds while retaining the pre-rebase API 37 member metadata; all 2,235 changed XML files parse, with 0 duplicate DocIds and 0 conflict markers.

Could you please re-review?

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three completeness blockers remain in the API 37 regeneration:

  • A full Android 37 source/signature audit finds 644 new API owners across 159 files still missing 1,179 source-documented elements (14 type descriptions, 623 member descriptions, 159 returns, and 383 parameters), including HealthPermissions.ReadActivityIntensity, String.SplitWithDelimiters, Notification.Metric.FixedTime, and PrinterInfo.Builder.SetSetupIntent.
  • Preservation still drops 49 substantive base elements: 48 type-level summaries/remarks across 46 matched types plus the unchanged ActivityManager.GetRecentTasks summary.
  • Removing IInputType leaves four exact-head broken xrefs, and OpenPublishing reports 27 deleted public destinations without redirects.

Please repair the API 37 source import, extend preservation to type-level docs and the missing member summary, update stale references, and add redirects/historical handling for every removed destination.

@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers/api-37-docs branch from e2c92f3 to 4133f38 Compare September 10, 2026 19:59
@jonathanpeppers

Copy link
Copy Markdown
Member Author

Rebased onto current main (2896cdd4), resolved the generated XML conflicts, and addressed the completeness/navigation review blockers.

  • Preserved 48 type-level and 4 member-level authored documentation elements from the latest base; the full preservation audit now reports 0 placeholder or missing substantive regressions across 130,059 matched members.
  • Imported 3,862 exact API 37 placeholder elements from cached official Android/Java sources, plus the explicitly cited HealthPermissions.ReadActivityIntensity owner (2 elements). Final offline dry-runs report 0 applicable changes and 0 errors.
  • Updated all 4 stale IInputType xrefs, added redirects for the removed IInputType and AndroidClientHandler type destinations, and retained 7 removed member nodes as net-android-36.0 history.
  • Full PR validation: 2,228 API XML files parsed, 0 duplicate DocIds, 0 broken exact-head IInputType xrefs, and git diff --check is clean.

@dalexsoto review requested again.

@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API 37 output still has four independent blockers:

  1. The regeneration erases existing current documentation. A signature-keyed preservation audit finds at least 283 direct substantive channels across 68 current XML files replaced by To be added. or removed. For example, RegexOptions.xml:243-246 erases the current UnicodeCharacterClass field summary, while AppInfo.xml:173-176 replaces the existing DescribeContents summary, return and remarks. Preserve all signature-matched base documentation before importing API 37 content and rerun the preservation audit.

  2. --api-since 37 omits platform-versioned API 37 owners that lack a literal ApiSince=37. SelectOwners gates every owner through HasApiSince, which only recognizes the register attribute. There are 445 current direct owners marked SupportedOSPlatform("android37.0") without that attribute whose summaries remain placeholders; AppSearchResultCode.Unavailable is a direct JNI-mapped example. Include exact platform-version availability (and applicable type inheritance) in selection, then rerun the API 37 completeness import.

  3. The retained historical framework indexes reference member DocIds removed from the documentation set. net-android-35.0.xml:84250-84254 still lists the CallType CallControl.Answer and RequestVideoState identities, but CallControl.xml:57-60 retains only the distinct System.Int32 signature. The same mismatch remains for the old JniValueManager.ActivatePeer ID. Preserve appropriate historical member records or add compatible member redirects so the versioned API inventory resolves.

  4. InputType directs users to a removed current API. InputType.xml:20 says to use Android.Text.IInputType, but the current inventory contains InputTypes and no IInputType; the new redirect also targets InputTypes. Correct the obsolete guidance in the generated signature/source or retain a valid current IInputType API.

@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers/api-37-docs branch from 4133f38 to e7c41c5 Compare September 11, 2026 15:38
@jonathanpeppers

Copy link
Copy Markdown
Member Author

Rebased onto current main (b5c16ebb), resolved the generated XML/importer conflicts, and addressed review 5173926919.

  • Preservation: the latest-base audit now reports 0 placeholder or missing substantive channels across 130,064 matched members. The rebase incorporated the newly authored docs, and the remaining 2 clobbered channels were restored.
  • API 37 selection: --api-since now recognizes exact SupportedOSPlatform("android37.0") metadata and inherits type availability only for members without their own version metadata. This imported 425 additional authoritative elements across 111 files. The final offline dry-run reports 0 applicable changes and 0 errors; one exact source field with no usable prose remains a conservative source_documentation_empty skip.
  • Historical inventory: restored the CallType overloads of CallControl.Answer and RequestVideoState, plus the old JniValueManager.ActivatePeer, as net-android-35.0 member records.
  • Navigation: corrected InputType guidance to point to Android.Text.InputTypes.
  • Validation: 2,230 PR API XML files parse, 0 ordinal duplicate DocIds, 0 conflict markers, and git diff --check is clean.

@dalexsoto review requested again.

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current API records still lose preserved documentation after signature projection. AppFunctionManager.SetAppFunctionEnabled:662-705 retains the same JNI identity after AppFunctionState became AppFunctionEnabledState, but all parameters, summary, and remarks are placeholders. ActivityManager.GetRecentTasks also replaces its exact-DocId summary with an empty element, and current CallControl.Answer/RequestVideoState forms retain placeholder remarks while prose exists only on historical alternates. Match active replacement records by stable JNI identity, treat empty elements as regressions, and restore base documentation to the current signatures.

jonathanpeppers and others added 11 commits September 11, 2026 14:18
Regenerate the Android API reference from the API 37 Mono.Android bindings and matching Android SDK sources.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Restore substantive documentation from main where API 37 generation introduced placeholder text after rebasing over the API 36.1 update.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
OpenPublishing requires unique ECMA member DocIds. Remove identical member
copies retained while resolving the API 36.1 and API 37 generated-doc
conflicts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
API 37 continues updating the existing .NET for Android Learn view. Reuse
the published net-android-36.0 moniker for the generated framework
inventory instead of referencing the undefined net-android-37.0 moniker.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
Restore substantive documentation from main by exact or structural member
signature, including elements that were replaced with placeholders or removed.
Keep the API 37 member metadata while removing duplicate DocIds introduced by
the rebase.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
Update restored phone-number formatting documentation to use country/region
while retaining the ISO 3166-1 standards terminology unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
Preserve authored documentation from the latest base, import exact official
Android and Java source documentation for API 37, and retain navigation
for removed public destinations.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
Recognize platform availability when selecting API-level documentation,
restore current authored documentation and historical member identities, and
correct the removed InputType replacement guidance.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
Restore substantive documentation by exact member identity and stable JNI registration, including empty documentation channels, then complete remaining cached API 37 source imports.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
@jonathanpeppers
jonathanpeppers force-pushed the jonathanpeppers/api-37-docs branch from 15bc49b to 27dda43 Compare September 11, 2026 19:28
@jonathanpeppers

Copy link
Copy Markdown
Member Author

Addressed the preservation review and rebased onto current main (3141a663).

  • Restored AppFunctionManager.SetAppFunctionEnabled parameters, summary, and remarks by stable JNI identity after the managed enum projection changed.
  • Restored the empty ActivityManager.GetRecentTasks summary.
  • Restored substantive remarks on the active CallControl.Answer and RequestVideoState records while retaining their historical alternates.
  • Restored 69 substantive latest-main documentation channels across 17 files; the preservation pass was idempotent on its second run.
  • Applied 867 additional exact cached official-source API 37 channels across 244 files.

Validation: importer self-test passed; final offline API 37 dry-run reports 0 applicable changes and 0 errors; 2,232 changed XML files parse; 0 ordinal duplicate DocIds; 0 conflict markers; 0 localization files; git diff --check passes.

@dalexsoto review requested again.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
@jonathanpeppers

Copy link
Copy Markdown
Member Author

@dalexsoto review

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the complete 2,237-file revision 7ac03ee5d2f825f6e86a10c2e5dcc0a807eb4e22, including the generated corpus and publication paths. The latest SetAppFunctionEnabled, GetRecentTasks, and active CallControl preservation examples are fixed. Three blockers remain:

  1. Preserve substantive documentation when regenerated text is nonempty but unusable. Forty-four exact-identity summaries across 19 files now contain slash separators or { instead of their existing descriptions, for example CharSequenceTransformation.xml:140-144. Twenty additional publish-relevant remarks channels lose nonredundant contract prose; NfcAdapter.xml:3412-3414 is one example where Android Beam availability/lifecycle/callback guidance becomes attribution alone. Restore these base channels and extend preservation validation beyond empty elements and To be added. to syntax-only and attribution-only replacements. The complete affected inventory is below.

  2. Make the five retained historical method destinations publishable or redirect them. PdfPagePathObject.SetFillColor/SetStrokeColor, PdfPageTextObject.SetFillColor/SetStrokeColor, and JniRuntime.JniValueManager.TryConstructPeer have restored XML records but are absent from all three framework inventories (see net-android-36.0.xml:27917-27922). A signature's FrameworkAlternate alone does not retain the destination: ECMA2Yaml's member filter requires framework-index membership, and the exact-head publishing report confirms all five destinations are deleted without redirection. Add appropriate historical inventory membership or effective redirects for the emitted member destinations.

  3. Attach app-function parameter descriptions to the actual managed names. IAppFunction.OnExecuteAppFunction:69-77 declares p0, p1, and p2, whose matching documentation remains To be added.. The imported prose is instead under nonexistent parameter names request, cancellationSignal, and callback. Publication looks up descriptions by the managed parameter name, so the real parameters remain undocumented, including the requirement that the callback complete exactly once. Move the existing descriptions to the verified p0/p1/p2 correspondence and remove the unmatched duplicate keys; the JNI argument order matches the immutable AOSP declaration.

These additional failures already exist at 15bc49bf089049beed2fa1b642b91d897171e6b0: they are earlier review-completeness misses, not newly introduced regressions in the latest update. None requires broadening the accepted conservative source-import policy.

Complete preservation-loss inventory

All paths below are under docs/xml/.

Files Summary channels lost
Android.Service.Autofill/{BatchUpdates,CharSequenceTransformation,CustomDescription,Dataset,DateTransformation,DateValueSanitizer,FillResponse,ImageTransformation,LuhnChecksumValidator,RegexValidator,SaveInfo,TextValueSanitizer,UserData,VisibilitySetterAction}.xml DescribeContents() and WriteToParcel(Android.OS.Parcel, Android.OS.ParcelableWriteFlags) in each file: 28
Android.Views.Autofill/AutofillValue.xml The same two parcelable methods: 2
Android.Text/Layout.xml IsFallbackLineSpacingEnabled: 1
Java.Util.Concurrent/LinkedBlockingDeque.xml Peek() and Poll(): 2
Java.Util/Objects.xml Compare, DeepEquals, Equals, HashCode, IsNull, NonNull, RequireNonNullElse, RequireNonNullElseGet, ToString(Object), and ToString(Object,String): 10
Org.Xml.Sax.Ext/Attributes2Impl.xml IsDeclared(System.Int32): 1
Total 44 summaries

The 20 nonredundant, publish-relevant remarks losses are:

Files Remarks channels lost
Android.Media/RemoteControlClient+MetadataEditor.xml PutLong(Android.Media.MetadataKey,System.Int64) and PutString(Android.Media.MetadataKey,System.String): changes after apply() are not displayed
Android.Nfc/NfcAdapter.xml SetNdefPushMessage(NdefMessage,Activity,Activity[]) and SetNdefPushMessageCallback(ICreateNdefMessageCallback,Activity,Activity[]): availability, lifecycle, callback-precedence and permission guidance
Android.Service.Autofill/{CharSequenceTransformation,CustomDescription,Dataset,FillResponse,ImageTransformation,LuhnChecksumValidator,RegexValidator,SaveInfo}.xml Both parcelable methods listed above in each file: 16 contract remarks

The review used complete immutable base/head comparisons, authoritative source checks, independent XML reductions, and static publication-path tracing; downloaded PR code was not executed.

Restore the complete reviewed documentation inventory, publish retained historical member destinations, and attach app-function parameter documentation to the generated managed names.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 57877110-585b-4e24-a34e-ec6cddc48db2
@jonathanpeppers

Copy link
Copy Markdown
Member Author

Addressed review 5189985635 on d7b005cb:

  • Restored all 44 listed exact-identity summaries from the immutable 3141a663 base, replacing slash/brace-only generated text.
  • Restored all 20 listed nonredundant remarks channels, including Android Beam lifecycle, callback precedence, availability, and permission guidance.
  • Added the four retained PDF color-setter DocIds and JniValueManager.TryConstructPeer to net-android-36.0, matching their FrameworkAlternate records so ECMA2Yaml can publish the destinations.
  • Moved IAppFunction.OnExecuteAppFunction descriptions onto the actual managed p0/p1/p2 names and removed the unmatched duplicate keys.

Validation: 64/64 requested channels restored; importer self-test passed; offline API 37 dry-run reports 0 applicable changes and 0 errors; all 23 changed XML files parse; all 5 historical destinations occur exactly once in the API 36 inventory; app-function parameters and documentation keys match exactly; no localization changes, conflict markers, or git diff --check errors.

@dalexsoto review requested again.

@dalexsoto dalexsoto left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the complete current PR at d7b005cb3d89f4a352ad005274cd00b51fc09644. All 44 summaries and 20 remarks are restored exactly from the immutable base. The five historical methods now have unique, correctly parented framework membership and no longer appear in the publishing deletion diagnostics. IAppFunction descriptions bind correctly to p0/p1/p2, retaining the exactly-once callback requirement.

Earlier preservation, API-37 availability, history and cross-reference fixes remain intact, and the accepted conservative source policy is unchanged. No high-confidence blocking issues remain.

@jonathanpeppers jonathanpeppers changed the title [API 37] Update Android API documentation [API 37] Regenerate .NET for Android API documentation Sep 16, 2026
@jonathanpeppers
jonathanpeppers merged commit 35e5564 into main Sep 16, 2026
3 checks passed
@jonathanpeppers
jonathanpeppers deleted the jonathanpeppers/api-37-docs branch September 16, 2026 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants